import { AppstoreOutlined, MailOutlined, SettingOutlined } from '@ant-design/icons';
import React from 'react';
import {Button,Layout,Menu   } from 'antd';
import 'antd/dist/antd.css'; // or 'antd/dist/antd.less'
import './Home.css'
import { Space, Table, Tag } from 'antd';

function getItem(label, key, icon, children, type) {
    return {
      key,
      icon,
      children,
      label,
      type,
    };
  }

  const items = [
    getItem('起始页', 'sub1', <MailOutlined />, [
        getItem('后台首页', '1')
    ]),
    getItem('舆情报告', 'sub2', <AppstoreOutlined />, [
        getItem('全部舆情', '5'),
        getItem('正面舆情', '6'),
        getItem('负面舆情', '7'),
        
      ]),
      getItem('舆情设置', 'sub4', <SettingOutlined />, [
        getItem('舆情关键词设置', '9'),
        getItem('舆情报警设置', '10'),
      ]),
    
  ];
  const columns = [
    {
      title: '必须包含关键字',
      dataIndex: 'name',
      key: 'name',
      render: (text) => <span>{text}</span>,
    },
    {
      title: '可包含关键字',
      dataIndex: 'age',
      key: 'age',
    },
    {
      title: '不包含关键字',
      dataIndex: 'address',
      key: 'address',
    },
    {
      title: '监控频率',
      dataIndex: 'pinlv',
      key: 'pinlv',
    },
    
    {
      title: 'Action',
      key: 'action',
      render: (_, record) => (
        <Space size="middle">
          <a>  <Button type="primary">编辑</Button></a>
          <a>  <Button type="danger">删除</Button></a>
        </Space>
      ),
    },
  ];
  const data = [
    {
      key: '1',
      name: ' 我是',
      age: 'qwer',
      address: 'mnbv',
      pinlv:'1234',
  
    },
    {
      key: '2',
      name: '罗翔',
      age: 'hi',
      address: 'hihi',
      pinlv:'11',
     
    },
    {
      key: '3',
      name: '李四',
      age: '张三',
      address: '',
      pinlv:'14',
     
    },
  ];
 
    
function Home(){
    const { Sider, Content } = Layout;
    const onClick = (e) => {
        console.log('click ', e);
      };
    return <div>
        <Layout>
        <Layout>
          <Sider>
          <Menu
      onClick={onClick}
      style={{
        width: 200,
      }}
      defaultSelectedKeys={['1']}
      defaultOpenKeys={['sub1']}
      mode="inline"
      items={items}
    />
          </Sider>
          <Content>


          <div className='top'>
          <Button type="primary">增加舆情关键词</Button>
          </div>
          <div className="center">
          <Table columns={columns} dataSource={data} pagination={false} />
          </div>
          </Content>

        </Layout>
       
      </Layout>
    </div>
    
}
export default Home
